package cate.game.role.farm.pk;

import cate.common.table.d.GDFight;
import cate.common.table.d.GDVideoHall;
import cate.game.play.proce.play.PlayPO;
import cate.game.role.Role;
import cate.game.role.farm.AbstractFarmFTC;
import cate.game.role.farm.pk.msg.PkResultResp;

public class PkFTC extends AbstractFarmFTC<MyPkPO> {

    public PkFTC(Role role) {
        setup(role);
    }

    @Override
    protected MyPkPO po(Role role) {
        return role.getFarm().pk;
    }

    @Override
    public void handleResult(Role role, PlayPO playPO) {
        super.handleResult(role, playPO);
        boolean win = playPO.winner == GDFight.Team.A;
        po(role).recordResult(win);
        role.sendNow(new PkResultResp(win));
        po(role).noticeUpdate();
        role.getGame().videoHall.addVideo(GDVideoHall.Group.CAI_JI_HU_ZHUO, playPO);
    }
}
